package com.piggy.logi.sys.api.factory;

import com.piggy.common.core.domain.R;
import com.piggy.common.core.web.page.TableDataInfo;
import com.piggy.logi.sys.api.RemoteLogiMenuService;
import com.piggy.logi.sys.api.RemoteLogiPriceSegService;
import com.piggy.logi.sys.api.bo.LogiPriceSegEditBo;
import com.piggy.logi.sys.api.bo.LogiPriceSegQueryBo;
import com.piggy.logi.sys.api.bo.LogiSysMenuBo;
import com.piggy.logi.sys.api.vo.LogiPriceSegExtVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 菜单服务降级处理
 *
 * @author shark
 */
@Component
public class RemoteLogiPriceSegFallbackFactory implements FallbackFactory<RemoteLogiPriceSegService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteLogiPriceSegFallbackFactory.class);

    @Override
    public RemoteLogiPriceSegService create(Throwable throwable) {
        log.error("菜单服务调用失败:{}", throwable.getMessage());
        return new RemoteLogiPriceSegService()
        {
            @Override
            public TableDataInfo<LogiPriceSegExtVo> innerList(LogiPriceSegQueryBo bo, String source) {
                return null;
            }

            @Override
            public R<LogiPriceSegExtVo> innerInfo(Long id, String source) {
                return null;
            }

            @Override
            public R<LogiPriceSegExtVo> innerAdd(LogiPriceSegEditBo bo, String source) {
                return null;
            }

            @Override
            public R<LogiPriceSegExtVo> innerEdit(LogiPriceSegEditBo bo, String source) {
                return null;
            }

            @Override
            public R<Integer> innerRemove(@NotEmpty(message = "主键不能为空") Long[] ids, String source) {
                return null;
            }
        };
    }
}
